package edu.java.homework.hw09.exercises.salads;

import edu.java.homework.hw09.exercises.salads.salads.ShepherdSalad;
import edu.java.homework.hw09.exercises.salads.salads.ShoppSalad;

/**
 * Shows the procedure of preparing of the salads.
 * 
 * @author Tsvetan Vasilev
 * 
 */
public class SaladCook {
    // --- Instance Variables --------------------------------------------------
    private static SaladCook instance = null;

    // --- Constructors --------------------------------------------------------
    private SaladCook() {
    }

    // --- Methods(Singleton) --------------------------------------------------
    public static SaladCook instance() {
	if (instance == null) {
	    instance = new SaladCook();
	}
	return instance;
    }

    // --- Methods(Factory) ----------------------------------------------------

    public ShepherdSalad prepareShepherdSalad() {

	ShepherdSalad shepherd = new ShepherdSalad();
	shepherd.prepareComponents();
	System.out.println(shepherd.toString());

	// operations with components
	wash();
	peel();
	cut();
	boil();
	grate();
	mix();

	return shepherd;
    }

    public ShoppSalad prepareShoppSalad() {

	ShoppSalad shopp = new ShoppSalad();
	shopp.prepareComponents();
	System.out.println(shopp.toString());

	// operations with components
	wash();
	peel();
	cut();
	boil();
	grate();
	mix();

	return shopp;
    }

    // --- Methods -> describe operations in cooking ---------------------------

    public void wash() {
	System.out.println("Wash:");
    }

    public void peel() {
	System.out.println("Peel: ");
    }

    public void cut() {
	System.out.println("Cut: ");
    }

    public void boil() {
	System.out.println("Boil:");
    }

    public void grate() {
	System.out.println("Grate:");
    }

    public void mix() {
	System.out.println("Mix: ");
    }

}
